home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998…tember: Reference Library / Dev.CD Sep 98 RL2.toast / What's New / Software Development Kits / MacOS USB DDK / Tools / USBDDKMPWMenu < prev   
Encoding:
Text File  |  1998-07-20  |  6.8 KB  |  150 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        BuildUSBMenu
  3. #
  4. #    Contains:    xxx put contents here xxx
  5. #
  6. #    Version:    xxx put version here xxx
  7. #
  8. #    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  9. #
  10. set echo 0
  11.  
  12. Set -e USBDDKObjects "{USBDDKFolder}Objects:";
  13. Set -e USBDDKTargets "{USBDDKFolder}Targets:";
  14. Set -e USBDDKReleaseExtensions "{USBDDKFolder}Extensions-DDKBuilt:";
  15. Set -e USBDDKMapDir "{USBDDKFolder}Targets:Maps:"
  16.  
  17. Set -e USBDDKDrivers "{USBDDKFolder}Drivers:";
  18. Set -e USBDDKExamples "{USBDDKFolder}Examples:";
  19. Set -e USBDDKInterfaces "{USBDDKFolder}Interfaces:";
  20. Set -e USBDDKRIncludes "{USBDDKFolder}Interfaces:";
  21. Set -e USBDDKLibraries "{USBDDKFolder}Libraries:";
  22.  
  23. Set -e USBDDKInterfacesExternal "{CIncludes}";
  24. Set -e USBDDKInterfacesInternal "{USBDDKFolder}Interfaces:";
  25.  
  26. # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  27. # Add the USBDDK menu with its associated items.
  28. Set USBDDKProjectMenuName USBDDK;                                    # USBDDK is the name of the menu
  29.  
  30. DeleteMenu "{USBDDKProjectMenuName}" ∑ dev:null || Echo ∑ dev:null            
  31.  
  32.  
  33. # ••••• Set Build mode (Engineering or SCM):
  34. #
  35. Alias SetBuildMenus 'If {USBDDKEngrBuild} ;                                                             ∂
  36.     AddMenu "USBDDK" "Engineering Build!√" "Set -e USBDDKEngrBuild 1; SetBuildMenus" ;                 ∂
  37.     AddMenu "USBDDK" "SCM Build" "Set -e USBDDKEngrBuild 0 ; SetBuildMenus" ;                         ∂
  38.   Else;                                                                                                     ∂
  39.     Set -e USBDDKSymbols "-sym off";                                                                     ∂
  40.     Set -e USBDDKMBGSymbols "-mbg off";                                                                 ∂
  41.     Set -e USBDDKDebugFlag 0;                                                                             ∂
  42.     Set -e DebugBuild 0;                                                                                     ∂
  43.     AddMenu "USBDDK" "Engineering Build" "Set -e USBDDKEngrBuild 1; SetBuildMenus" ;                 ∂
  44.     AddMenu "USBDDK" "SCM Build!√" "Set -e USBDDKEngrBuild 0; SetBuildMenus" ;                         ∂
  45.   End;'
  46.  
  47. SetBuildMenus;
  48.  
  49. AddMenu "{USBDDKProjectMenuName}" '(-' ''
  50.  
  51. # ••••• Does the basic build.
  52. #
  53. AddMenu "{USBDDKProjectMenuName}" 'Build Driver or Example/ç' 'Open "{Worksheet}"; "{USBDDKToolsFolder}"USBDDKBuildDriver ∑∑ "{Worksheet}"'
  54.  
  55.  
  56. # ••••• Does the basic full build by specifying the -e delimeter to the make function.
  57. # Warning!  This is dangerous because if a source file fails to assemble/compile, there still might be a corresponding 
  58. # old object file hanging around which would get linked in as if there was no problem... - DMS
  59. # AddMenu "{USBDDKProjectMenuName}" 'Full Build Driver or Example/ƒ' 'Open "{Worksheet}"; "{USBDDKToolsFolder}"USBDDKBuildDriver full ∑∑ "{Worksheet}"'
  60.  
  61.  
  62. # ••••• Deletes all the objects of the current driver as per its makefile - then does a full rebuild.
  63. #
  64. AddMenu "{USBDDKProjectMenuName}" 'Clean & Rebuild Driver or Example…' 'Open "{Worksheet}"; ∂
  65.                                                                 Confirm "Delete object files and rebuild?" || (Beep; Exit); ∂
  66.                                                                 "{USBDDKToolsFolder}"USBDDKBuildDriver clean ∑∑ "{Worksheet}"'
  67.  
  68. # ••••• Toggles the USBDDKSymbols variable to turn debugger symbols on or off
  69. #
  70. AddMenu "{USBDDKProjectMenuName}" 'Debug Symbols & Flags…'    'if "{USBDDKSymbols}" == "-sym on"; ∂
  71.                                                                 Confirm "Symbols and Flags are currently on. Turn all symbols off?" || (Beep; Exit); ∂
  72.                                                                 Set -e USBDDKSymbols "-sym off"; ∂
  73.                                                                 Set -e USBDDKMBGSymbols "-mbg off"; ∂
  74.                                                                 Set -e USBDDKDebugFlag 0; ∂
  75.                                                                 Set -e DebugBuild 0; ∂
  76.                                                             Else; ∂
  77.                                                                 Confirm "Symbols and Flags are currently off. Turn all symbols on?" || (Beep; Exit); ∂
  78.                                                                 Set -e USBDDKSymbols "-sym on"; ∂
  79.                                                                 Set -e USBDDKMBGSymbols "-mbg on"; ∂
  80.                                                                 Set -e USBDDKDebugFlag 1; ∂
  81.                                                                 Set -e DebugBuild 1; ∂
  82.                                                             End; ∂
  83.                                                             Echo "#  USBDDKSymbols = "{USBDDKSymbols} ∑∑ "{Worksheet}"; ∂
  84.                                                             Echo "#  USBDDKMBGSymbols = "{USBDDKMBGSymbols} ∑∑ "{Worksheet}"; ∂
  85.                                                             Echo "#  USBDDKDebugFlag = "{USBDDKDebugFlag} ∑∑ "{Worksheet}"; ';
  86.  
  87.  
  88.  
  89. AddMenu "{USBDDKProjectMenuName}" "(-" "";
  90.  
  91.  
  92. # ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  93. # This for loop puts all of the drivers directories in the USBDDK menu.
  94. # When the driver name is selected in the menu, the current directory is set to where that folder currently exists.
  95. # The UserStartup script is executed again to get the proper menu un-checked and checked. 
  96. #
  97. #echo "Add select driver"
  98. set foldersfound 0
  99. AddMenu "{USBDDKProjectMenuName}" 'Select Driver in DriverSrc Folder' '';
  100. if `Exists "{USBDDKFolder}DriverSrc"`
  101.     For i In `Files -af -f -d "{USBDDKFolder}DriverSrc"`                        # For all directories in Sources folder....
  102.         (Evaluate "{i}" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null                        # Get the name of the folder, put in ®1
  103.         Set char ''                                                                # else make sure there is no checkmark.
  104.         AddMenu "DDKDriverList" "{®1}{char}"   "(Directory ∂"{i}∂") ∑∑ ∂""{Worksheet}"∂" ; set -e USBDDKDriverPath {i};  set -e USBDDKDriver {®1}";    
  105.         set foldersfound '1'
  106.     End
  107.     if {foldersfound} == '1'
  108.         AddMenu -link "{USBDDKProjectMenuName}" 'Select Driver in DriverSrc Folder' 'DDKDriverList';
  109.     End
  110. End
  111.  
  112. #echo "Add select example"
  113. set foldersfound 0
  114. AddMenu "{USBDDKProjectMenuName}" 'Select Example' '';
  115. if `Exists "{USBDDKFolder}Examples"`
  116.     For i In `Files -af -f -d "{USBDDKFolder}Examples"`                        # For all directories in Examples folder....
  117.         (Evaluate "{i}" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null                        # Get the name of the folder, put in ®1
  118.         Set char ''                                                                # else make sure there is no checkmark.
  119.         AddMenu "ExampleList" "{®1}{char}" "(Directory ∂"{i}∂") ∑∑ ∂""{Worksheet}"∂" ; set -e USBDDKDriverPath {i};  set -e USBDDKDriver {®1}";    
  120.         set foldersfound '1'
  121.     End
  122.     if {foldersfound} == '1'
  123.         AddMenu -link "{USBDDKProjectMenuName}" 'Select Example' 'ExampleList';
  124.     End
  125. End
  126.  
  127. #echo "Add create driver menu item"
  128. AddMenu "{USBDDKProjectMenuName}" '(-' '';
  129. AddMenu "{USBDDKProjectMenuName}" 'Create New Driver in DriverSrc folder…' 'Open "{Worksheet}"; ∂
  130.         Set NewDriverName "`(Request "What is the name of the new driver?")≥dev:null`"; ∂
  131.         if ¬ `Exists "{USBDDKFolder}DriverSrc:""{NewDriverName}"`; ∂
  132.             NewFolder "{USBDDKFolder}DriverSrc:""{NewDriverName}"; ∂
  133.         End;  ∂
  134.         Execute "{USBDDKToolsFolder}USBDDKMPWMenu"; '
  135.  
  136. #echo "Add build menu items"
  137. AddMenu "{USBDDKProjectMenuName}" '(-' '';
  138. AddMenu "{USBDDKProjectMenuName}" 'Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
  139.                                                             directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
  140.                                                              "{USBDDKToolsFolder}"USBDDKBuildAll ∑∑ "{Worksheet}";'
  141.  
  142. AddMenu "{USBDDKProjectMenuName}" 'Clean & Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
  143.                                                             directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
  144.                                                              "{USBDDKToolsFolder}"USBDDKBuildAll clean ∑∑ "{Worksheet}";'
  145.  
  146. AddMenu "{USBDDKProjectMenuName}" 'Full Build All USB Drivers and examples…'     'Open "{Worksheet}"; ∂
  147.                                                             Confirm "FULL Build of all USB Drivers?∂n" || (Beep; Exit); ∂
  148.                                                             directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
  149.                                                             "{USBDDKToolsFolder}"USBDDKBuildAll full ∑∑ "{Worksheet}";'
  150.